package com.fengdi.book.easy.Array;

public class Rotate {
    public void rotate(int[] nums, int k) {

        int length = nums.length;
        int[] temp = new int[length];
        System.arraycopy(nums, 0, temp, 0, length);

        for (int i = 0; i < length; i++) {
            nums[(i + k) % length] = temp[i];
        }

    }
}
